<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jQ事件:change</title>
</head>
<body>
    <input type="text" name="" id="">
    <p>在输入框写一段文字，然后按下Enter键或点击输入框外部，这段文字会发生变化。</p>
</body>
<script src="jquery.min.js"></script>
<script>
    $(document).ready(function(){
        $("input").change(function(){
            $("p").html($("input").val());
            alert("p标签被修改");
        })
    })
</script>
</html>